package com.caozhi.mspeoject.nb_search.repository;

import com.woniuxy.boot.common.bean.EsFeedback;
import com.woniuxy.boot.common.bean.EsPolicy;
import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.elasticsearch.repository.ElasticsearchRepository;
import org.springframework.stereotype.Repository;

import java.util.List;
@Repository
public interface PolicySearchRepository extends ElasticsearchRepository<EsFeedback, Long> {
    @Query("{\"bool\": {\"should\": [{\"term\": {\"no\": ?0}}, {\"term\": {\"name\": ?1}},{\"term\": {\"phone\": ?2}},{\"term\": {\"frameNumber\": ?3}},{\"term\": {\"carNumber\": ?4}}],\"minimum_should_match\": 1}}")
    List<EsPolicy> findByNoOrNameOrPhoneOrFrameNumberOrCarNumber(String no , String name , String phone, String frameNumber, String carNumber);
    void deleteAll();
}
